Scheduler for UWP | ComponentOne
Features / Views / Adding Holidays
In This Topic
    Adding Holidays
    In This Topic

    Adding a holiday to your C1Scheduler control is easy with the CalendarHelper class. With just a few lines of code, you can block off a day as a holiday. Any day specified as a holiday won't appear in a C1Scheduler whose ViewType property is set to WorkWeek.

     Use the following code to set a holiday on your calendar. The code below sets Christmas (December 25th) as a holiday:

    C#
    Copy Code
    sched1.CalendarHelper.Holidays.Add(new DateTime(2014, 12, 25));
    

    And here's the WorkWeek view for the week of Christmas: